[WEEK10] 추슬기#46
Merged
Merged
Conversation
raejun92
reviewed
Apr 15, 2026
Collaborator
raejun92
left a comment
There was a problem hiding this comment.
문제 풀이가 잘못 올라와 있는 것 같아요!
Member
Author
There was a problem hiding this comment.
코덱스 한번 잡도리했습니다 ㅠ 다시 올려두었어요 👍
| let zeroCount = 0; | ||
|
|
||
| while (s !== "1") { | ||
| const length = s.replaceAll("0", "").length; |
raejun92
approved these changes
Apr 19, 2026
LeeBaeJin
approved these changes
Apr 20, 2026
Collaborator
LeeBaeJin
left a comment
There was a problem hiding this comment.
최솟값 만들기 문제보고 감탄했습니다! ㅋㅋㅋ 수고많으셨습니다!
Collaborator
There was a problem hiding this comment.
와 ㅋㅋㅋ 그냥 코드 두줄로 끝낼수 있는 문제였나요
LeeBaeJin
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
이렇게 풀었어요
1. 최솟값 만들기
1) 복잡도 계산
2) 접근 아이디어
3) 회고
가장 큰 값 * 가장 작은 값으로 해서 더하면 가장 작은 값이 나올 것 같아 해당 풀이로 진행했다.
2. 이진 변환 반복하기
1) 복잡도 계산
2) 접근 아이디어
0을 제거한 뒤 남은1의 개수를 구했다.0개수를 누적하면서, 남은1개수를 다시 이진 문자열로 변환했다."1"이 될 때까지 반복하면서 변환 횟수와 제거한 0의 총개수를 반환했다.3) 회고
이진법 변환이나 이진법 방식을 이해하면 더 쉽게도 풀 수 있을 것 같다.
다른 사람 풀이:
다른 사람 풀이 핵심: 문자열을 새로 만들기보다
for문으로 1과 0의 개수를 바로 세서 필요한 값만 남기는 방식이었다.내 생각: 지피티한테 더 성능 좋은 풀이를 비교했는데, 카운팅 하는 방식으로
for문으로 구현하는 게 문자열을 새로 만들지 않아도 되서 이 방법도 좋을 것 같다.